checkNotNull
Ensures that an object reference passed as a parameter to the calling method is not null.
Return
the non-null reference that was validated
Parameters
reference
an object reference
Throws
if reference
is null
open fun <T> checkNotNull(@Nullable reference: @Nullable T, @NonNull errorMessage: @NonNull Any): @NonNull T(source)
Ensures that an object reference passed as a parameter to the calling method is not null.
Return
the non-null reference that was validated
Parameters
reference
an object reference
errorMessage
the exception message to use if the check fails; will be converted to a string using valueOf
Throws
if reference
is null